package game.console;

import java.awt.event.KeyEvent;

public class GameConsole extends AbstractConsole
{
    private static GameConsole instance;
    
    public static synchronized GameConsole getInstance()
    {
        if (instance == null)
        {
            instance = new GameConsole();
            instance.setXY(0, 0);
        }
        return instance;
    }
    
    private final char consoleKey   = '^';
    
    private boolean    CONSOLE_OPEN = false;
    
    public boolean consoleKeyPressed(KeyEvent e)
    {
        return e.getKeyCode() == KeyEvent.VK_F1;
    }
    
    public boolean isOpen()
    {
        return CONSOLE_OPEN;
    }
    
    public void openConsole()
    {
        CONSOLE_OPEN = true;
    }
    
    public void closeConsole()
    {
        clearLineBuffer();
        CONSOLE_OPEN = false;
    }
}
